﻿using System;
using System.Collections.Generic;

namespace Web.Components
{
    public sealed class MiniShoppingCart
    {
        /// <summary>
        /// 商品总数量
        /// </summary>
        public int Quantity { get; private set; }
        /// <summary>
        /// 总计
        /// </summary>
        public decimal Total { get; private set; }
        /// <summary>
        /// 商品项
        /// </summary>
        public IList<MiniShoppingCartItem> Items { get; private set; }

        public MiniShoppingCart(int quantity, decimal total, IList<MiniShoppingCartItem> items)
        {
            Quantity = quantity;
            Total = total;
            Items = items;
        }
    }

    public sealed class MiniShoppingCartItem
    {        /// <summary>
        /// 商品Id
        /// </summary>
        public long Id { get; set; }
        /// <summary>
        /// 商品名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 变体Id
        /// </summary>
        public Guid VariantId { get; set; }

        /// <summary>
        /// 变体名称
        /// </summary>
        public string VariantName { get; set; }

        /// <summary>
        /// 金额(减去折扣后的金额)
        /// </summary>
        public decimal Price { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public int Quantity { get; set; }

    }
}